﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_LayoutForm.cshtml";
}
<script>
    $(function () {
        initSearchControl({
            id: 'winSearch',
            name: 'WindowNumber',
            value :'@Model.WindowNumber',
            displayText : '@ViewBag.WinName',
            height:280,
            dataSource: @Html.Raw(this.ViewBag.WinList),
            colModel: [{
                        label: '窗口ID',
                        name: 'ID',
                        width: 60,
                        key: true
                    }, {
                        label: '窗口名称',
                        width: 120,
                        name: 'Name'
                    }, {
                        label: '窗口号',
                        name: 'Number'
                    }]
        });
    });
    function submitForm(callback) {
        $.submitForm({
            url: "SubmitForm",
            data: $('form').serializeForm(),
            callback: callback
        });
    }
</script>
<div class="page-content">
    <div class="row">
        <div class="col-xs-12">
            <form class="form-horizontal" style="margin-top: 30px">
            <input  type="hidden" name= "ID" value="@Model.ID" />
            <input  type="hidden" name= "AreaNo" value="@Model.AreaNo" />
            <div class="form-group">
                <label class="col-sm-3 col-xs-3">
                    ID
                </label>
                <div class="col-sm-9 col-xs-9">
                    <input id="txtId" readonly type="text" class="col-xs-10 col-sm-10" />
                    <script>
                        var id = $("form input[name='ID']").val();
                        if (id == -1)
                            $("#txtId").val("新增");
                        else
                            $("#txtId").val(id);
                    </script>
                </div>
            </div>
            <input  type="hidden" name= "ControllerID" value="@Model.ControllerID" />
            <div class="form-group">
                <label class="col-sm-3 col-xs-3">
                    所属控制器
                </label>
                <div class="col-sm-9 col-xs-9">
                    <input type="text" readonly value="@ViewBag.ControllerName" autocomplete="off" class="col-xs-10 col-sm-10" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 col-xs-3">
                    对应窗口
                </label>
                <div class="col-sm-9 col-xs-9">
                    <input type="text" id="winSearch" displaymember='Name' valuemember='Number' autocomplete="off"
                        class="col-xs-10 col-sm-10" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 col-xs-3">
                    显示文本
                </label>
                <div class="col-sm-9 col-xs-9">
                    <input type="text" name="DisplayText" value="@Model.DisplayText"  autocomplete="off" class="col-xs-10 col-sm-10" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 col-xs-3">
                    屏幕位置
                </label>
                <div class="col-sm-9 col-xs-9">
                    <input type="text" name="Position" value="@Model.Position"  autocomplete="off" class="col-xs-10 col-sm-10" />
                </div>
            </div>
            </form>
        </div>
    </div>
</div>
